<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>Logout</title>
</head>
<body>
<script>
    function logoutSuccess() {
        var t = 5;
        var timer = setInterval(time, 1000);
        var spans = document.getElementById("begin");

        function time() {
            t--;
            spans.innerHTML = '<span>' + t + '</span>';
            if (t == 0) {
                clearInterval(timer);
                return window.location.href = 'home.php';
            }
            console.log(t);
        }
    }
</script>



<a href="{:url('index/index')}">登出成功！<span id="begin">5</span>秒后跳转</a>
<script>
    logoutSuccess();
</script>

</body>
</html>